pixelcache: Add map/unmap functions
authorBenjamin Otte <otte@redhat.com>
Wed, 9 Apr 2014 21:31:21 +0000 (23:31 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 9 Apr 2014 22:16:53 +0000 (00:16 +0200)
Because GTK does not invalidate windows that aren't mapped, we cannot
update the pixel cache when the window it handles isn't mapped. So we
add API to call when GDK windows get mapped/unmapped.

https://bugzilla.gnome.org/show_bug.cgi?id=726475

gtk/gtkpixelcache.c
gtk/gtkpixelcacheprivate.h

index 2a909641f7bce67a91ff3be32de25b9b76370275..339518bf8a9f14e4e619137fe1b5474d3861ec08 100644 (file)
@@ -467,3 +467,15 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache,
       draw (cr, user_data);
     }
 }
+
+void
+_gtk_pixel_cache_map (GtkPixelCache *cache)
+{
+  _gtk_pixel_cache_invalidate (cache, NULL);
+}
+
+void
+_gtk_pixel_cache_unmap (GtkPixelCache *cache)
+{
+  gtk_pixel_cache_blow_cache (cache);
+}
index 69635b7df2da941d1c0f03f5278874503eabcd0e..c31693e140732a1963998977d409bd9bbae512e1 100644 (file)
@@ -32,6 +32,8 @@ typedef void (*GtkPixelCacheDrawFunc) (cairo_t *cr,
 
 GtkPixelCache *_gtk_pixel_cache_new            (void);
 void           _gtk_pixel_cache_free           (GtkPixelCache         *cache);
+void           _gtk_pixel_cache_map            (GtkPixelCache         *cache);
+void           _gtk_pixel_cache_unmap          (GtkPixelCache         *cache);
 void           _gtk_pixel_cache_invalidate     (GtkPixelCache         *cache,
                                                 cairo_region_t        *region);
 void           _gtk_pixel_cache_draw           (GtkPixelCache         *cache,